﻿using System;
namespace Kis.Xroad.Eu {
    
    
    [System.SerializableAttribute()]
    public class SimpleFractionDigits : global::Xtee.Core.Schema.XsdDecimal {
        
        public SimpleFractionDigits(decimal value) : 
                base(value) {
            this.Komakohti = 2;
            this.Validate();
        }
        
        public SimpleFractionDigits(string value) : 
                base(value) {
            this.Komakohti = 2;
            this.Validate();
        }
        
        public SimpleFractionDigits() : 
                base(new decimal()) {
        }
        
        public static bool TryParse(string value, out global::Kis.Xroad.Eu.SimpleFractionDigits result) {
            try {
                result = new global::Kis.Xroad.Eu.SimpleFractionDigits(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator Decimal (SimpleFractionDigits value) {
            return value.Value;
        }
        
        public static implicit operator SimpleFractionDigits (decimal value) {
            return new SimpleFractionDigits(value);
        }
    }
}
